You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh-163004: Make unittest -v mean 2 whatever verbosity main() was given - #163005
-v was counted up from the verbosity passed to unittest.main(), so it only meant 2 when that was 1. It is now counted separately and replaces the verbosity only when given, so -v gives 2 and -vv gives 3 whatever the default.
The mixed -q/-v ordering may need an extra regression alongside the default-verbosity matrix. I extracted the unchanged _parse_args() and _getParentArgParser() methods from head 4e31891 and executed them with the installed Python 3.12.16 argparse (not a full PR module/build). For defaults 0, 1 and 2, the method-level probe gives:
-q stores -1 in _verbosity, so a subsequent count action increments from -1 before the final +1. In the installed 3.12 parser, -q -v gives 2 and -v -q gives 0.
Should the first -v after -q restart the verbose count, preserving that last-option behavior? A test for ['-q', '-v'] and ['-q', '-vv'] would catch the distinction; the new tests currently cover the flags separately. If mixed flags intentionally have different semantics now, documenting that would also help. AI-assisted source probe; no full main/PR build or patch-passing claim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-vwas counted up from the verbosity passed tounittest.main(), so it only meant 2 when that was 1. It is now counted separately and replaces the verbosity only when given, so-vgives 2 and-vvgives 3 whatever the default.unittest -vadds one to the verbosity given tounittest.main()#163004